package com.swordget.dao.impl;

import com.swordget.commons.JdbcUtil;
import com.swordget.dao.LogDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

/**
 * @Author: David
 * @Date: Created in 15:58 2021/2/25
 * @Description: 日志
 * @Modified By:
 * @Version:
 */

@Repository
public class LogDaoImpl implements LogDao {

    @Autowired
    private JdbcUtil jdbcUtil;


    @Override
    public void addLog(String id, String loginId, String content, String type, String org, String time) {
        String command = String.format("INSERT INTO SYS_LOGS(ID,LOGIN_ID,LOG_CONTENT,LOG_TYPE,LOG_ORG_CODE,LOG_DATE) " +
                "VALUES(GENERATOR_SEQ.NEXTVAL, '%s', '%s', '%s', '%s', '%s')", loginId, content, type, org, time);
        jdbcUtil.execute(command);
    }
}
